
        <div id="memberpositiontree" class="ztree">
          
         
        </div>


	<script type="text/javascript">
	

	
	
		var setting = { 
			view: {
				selectedMulti: false
			},
			async: {
				enable: true,
				url:"{:U('memberpositiontree',array('id' => $memberInfo['id']))}", 
				autoParam:["id", "name=n", "level=lv"],
				otherParam:{"otherParam":"zTreeAsyncTest"},
				dataFilter: filter
			},
			callback: { 
				beforeClick: beforeClick,
				beforeAsync: beforeAsync,
				onAsyncError: onAsyncError,
				onAsyncSuccess: onAsyncSuccess
			}
		};

		function filter(treeId, parentNode, childNodes) {
			if (!childNodes) return null;
			for (var i=0, l=childNodes.length; i<l; i++) {
				childNodes[i].name = childNodes[i].name.replace(/\.n/g, '.');
			}
			return childNodes;
		}
		function beforeClick(treeId, treeNode) {
			if (!treeNode.isParent) {
				return false;
			} else {
				return true;
			}
		}
		var className = "dark";
		function beforeAsync(treeId, treeNode) {
			className = (className === "dark" ? "":"dark");
			return true;
		}
		function onAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {
			
		}
		function onAsyncSuccess(event, treeId, treeNode, msg) {
			
		}

		$(document).ready(function(){
			$.fn.zTree.init($("#memberpositiontree"), setting);
		});

		

	</script>
